<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">    
    <fieldset>
        <legend>Cadastro de Músico</legend>
        <f:view>
            <h:form>
                <label jsf:for="name">Nome:</label>
                <br/>
                <input type="text" size="60" required="true" jsf:id="name" 
                    jsf:value="${musicianManagedBean.musician.name}"/>                
                <br/>
                <label jsf:for="birthday">Data de Nascimento:</label>
                <br/>
                <input type="date" required="true" jsf:id="birthday" 
                    jsf:value="${musicianManagedBean.musician.birthday}" >                
                <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT-3"/>                                
                </input>
                <br/>
                <label jsf:for="city">Cidade:</label>
                <br/>
                <select jsf:id="city" jsf:size="1" required="true" 
                        jsf:value="${musicianManagedBean.musician.originCity.id}">
                    <f:selectItem itemValue="" itemLabel="Selecione uma cidade..."/>
                    <f:selectItems value="${cityManagedBean.list}" var="city"
                        itemValue="${city.id}" itemLabel="${city.description}"/>                                
                </select>
                <br/>
                <label jsf:for="gender">Sexo:</label>
                <br/>
                <select jsf:id="gender" jsf:size="1" required="true" 
                        jsf:value="${musicianManagedBean.musician.gender}">
                    <f:selectItem itemValue="${util.male}" itemLabel="${util.male.gender}"/>
                    <f:selectItem itemValue="${util.female}" itemLabel="${util.female.gender}"/>
                </select>
                <br/>
                <textarea rows="10" cols="100"  maxlength="500" 
                    placeholder="Insira a biografia..." 
                    required="true" jsf:id="biography" 
                    jsf:value="${musicianManagedBean.musician.biography}"/>                        
                <br/>
                <input type="submit" class="button" value="Salvar" jsf:action="${musicianManagedBean.register}" jsf:id="salvar"/>                
                <input type="button" class="button" value="Cancelar" jsf:action="${musicianManagedBean.cancel}" jsf:id="cancelar"/>                    
            </h:form>
        </f:view>
    </fieldset>        
</html>

